//#include<iostream>
//using namespace std;
////int main()
////{
////	float s = 0.0;
////	cin >> s;
////	s = s * 0.75;
////	printf("%f",s);
////	return 0;
////}
//
//int main()
//{
//	char* s1;
//	cin >> s1;
//
//
//	string s1(cin >>s1 );
//	return 0;
//}

#include<iostream>
using namespace std;

int main()
{
    string s1;
    string s2;
    cin >> s1;
    cin >> s2;


    if (s2.find(s1) != -1)
    {
        cout << s1 << "is substring of" << s2;
    }
    else if (s1.find(s2) != -1)
    {
        cout << s2 << "is substring of" << s1;
    }
    else
    {
        cout << "No substring";
    }
    return 0;
}